
#include <dev.h>
#include "pci.h"

/* ------------------------------------------------------------------------- */

static pci_dev_t agp_dev;

static void fastcall agp_config(uint8 reg, uint32 data, uint32 mask);
static size_t fastcall agp_map_size(uint map);
static size_t fastcall agp_read_map(uint map, uint32 addr, void *data, size_t size);
static size_t fastcall agp_write_map(uint map, uint32 addr, const void *data, size_t size);

/* ------------------------------------------------------------------------- */

pci_dev_t *get_agp_device(void)
{
	memset(&agp_dev, 0, sizeof(agp_dev));

#ifndef NDEBUG
	strcpy(agp_dev.name, "AGP");
#endif

	agp_dev.conf.header_type = 0x01;	// PCI-to-PCI bridge use type 1 configuration

	agp_dev.config = &agp_config;
	agp_dev.map_size = &agp_map_size;
	agp_dev.read_map = &agp_read_map;
	agp_dev.write_map = &agp_write_map;

	return &agp_dev;
}

/* ------------------------------------------------------------------------- */

static void fastcall agp_config(uint8 reg, uint32 data, uint32 mask)
{

}

static size_t fastcall agp_map_size(uint map)
{
	return 0;
}

static size_t fastcall agp_read_map(uint map, uint32 addr, void *data, size_t size)
{
	return size;
}

static size_t fastcall agp_write_map(uint map, uint32 addr, const void *data, size_t size)
{
	return size;
}

/* ------------------------------------------------------------------------- */
